package com.xopencode.spring.引入外部文件;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.util.Assert;

/**
 * @Auther: Mcb
 * @Date: 2022/3/12 18:31
 * @Description:
 */
public class MyTest {


    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(config.class);
        UserInfo userInfo = context.getBean(UserInfo.class);
        userInfo = null;
        Assert.notNull(userInfo,"error");

        //打印用户信息
        System.out.println("用户编号：" + userInfo.getUserId());


    }
}
